package First;
import java.util.Scanner;
public class Isprimer {
    public static void main(String args[]){
        int num=0;
        for(int i=2;i<=20000;i++){
            int k=0;
            for(int j=2;j*j<=i;j++){
                if(i%j==0){
                    k=1;
                    break;
                }
            }
            if(k==0) {
                System.out.print(i+" ");
                num++;
                if(num==5){
                    System.out.print("\n");
                    num = 0;
                }
            }
        }
    }
}
